import request from '@/utils/request'

//1.登录请求参数类型
export interface reqLoginType{
    username:string,
    password:string
}
//登录请求返回值类型
export interface reqLoginReturnType{
    token:string
}
//登录请求
export const requestLogin = (loginPrams:reqLoginType) => {
    return request.post<any,reqLoginReturnType>('/admin/acl/index/login',loginPrams)
}

//2.获取用户信息请求返回值类型
export interface reqUserInfoReturnType{
    routes: string[],
    buttons: string[],
    roles: string[],
    name: string,
    avatar: string
}
//获取用户信息请求
export const requestUserInfo = () => {
    return request.get<any,reqUserInfoReturnType>('/admin/acl/index/info')
}


//退出登录
export const requestLogOut = () => {
    return request.post<any,null>('/admin/acl/index/logout')
}